package com.example.juc.function;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

public class Demo {
    public static void main(String[] args) {
        Function<String,String> function = x->{return x;};
        System.out.println(function.apply("hello"));


        Predicate<String> predicate = String::isEmpty;
        System.out.println(predicate.test("abc"));


        Consumer<String> consumer = System.out::println;
        consumer.accept("cwy");


        Supplier<String> supplier = ()->{return "666";};
        System.out.println(supplier.get());
    }
}
